Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove default value from counterReducer #5

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

zeezephyr
Copy link

Remove initialState default value in the counterReducer so that this test fails:

  test("should return a proper initial state when called with undefined state", () => {
    const state = {};
    const action = {
      type: "DO_NOTHING",
    };

    const newState = counterReducer(undefined, action);
    expect(newState).toEqual(initialState);
  });

From reading exercise 6.1 it seems like the intent is to have the student fix the reducer so the test passes. As it is currently written the test passes without any changes.

Remove initialState default value in the counterReducer so that this test fails:

```
  test("should return a proper initial state when called with undefined state", () => {
    const state = {};
    const action = {
      type: "DO_NOTHING",
    };

    const newState = counterReducer(undefined, action);
    expect(newState).toEqual(initialState);
  });
```

From reading the exercise it seems like the intent is to have the student fix the reducer so the test passes. As it is currently written the test passes without any changes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant